package controll
{
	import controll.XMLDataManager;
	
	import flash.events.EventDispatcher;
	import flash.utils.Dictionary;
	import flash.utils.getDefinitionByName;

	public class DataManager extends EventDispatcher
	{
		private static var m_dictionary:Dictionary = new Dictionary(true);
		private static var m_instance:*;
		public function DataManager()
		{
		}
		public static function getInstance():IDataManager
		{
			return m_instance;
		}
		public static function createInstance($class:String):IDataManager
		{
			var instance:IDataManager;
			var a:XMLDataManager;
			
			var obj:* = m_dictionary[$class];
			if (obj == null)
			{
				obj = new (getDefinitionByName($class) as Class) as IDataManager;
				m_dictionary[$class] = obj;
				m_instance = obj;
			}
			ProjectorLogger.getInstance().logger("init DataManager " + $class);
			return obj;
		}
	}
}